Code review sweep (run 24976350016)#18334
Merged
Merged
Conversation
Automated code review of instrumentation/jdbc/testing.
Automated code review of instrumentation/jedis/jedis-1.4/javaagent.
Automated code review of instrumentation/jedis/jedis-1.4/testing.
Automated code review of instrumentation/jedis/jedis-3.0/javaagent.
Automated code review of instrumentation/jedis/jedis-4.0/javaagent.
Automated code review of instrumentation/jetty-httpclient/jetty-httpclient-12.0/javaagent.
JedisRequest and JedisSingletons are referenced from advice woven into redis.clients.jedis.Connection; reducing them to package-private caused IllegalAccessError at runtime.
trask
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated code review sweep walked the following modules in order
and stopped after accumulating at least 10 modified files:
jdbc:testingjedis-1.4:javaagentjedis-1.4:testingjedis-3.0:javaagentjedis-4.0:javaagentjedis-common:javaagentjetty-httpclient-12.0:javaagentModule:
jdbc:testingModule path:
instrumentation/jdbc/testingSummary
Applied 2 safe review fixes in
instrumentation/jdbc/testing: standardized class-scoped datasource cleanup inAbstractJdbcInstrumentationTestand narrowed broadExceptionusage in the proxy test path.Applied Changes
Testing
File:
AbstractJdbcInstrumentationTest.java:129Change: Replaced the nested `@AfterAll` datasource shutdown loop with `cleanup.deferAfterAll(...)` registration during `@BeforeAll` setup, narrowed the fallback catch in `testConnectionConstructorThrowing()` to `IllegalStateException`, and narrowed `testProxyStatement()` from `throws Exception` to `throws ClassNotFoundException, SQLException`.
Reason: `testing-general-patterns.md` prefers `AutoCleanupExtension.deferAfterAll(...)` for class-scoped resources instead of custom `@AfterAll` cleanup chains, and test entry points should keep `throws` clauses and exception handling as specific as possible instead of using broad `Exception`.
File:
ProxyStatementFactory.java:17Change: Narrowed `proxyStatementWithCustomClassLoader(...)` from `throws Exception` to `throws ClassNotFoundException`.
Reason: The helper only exposes `ClassNotFoundException` from `loadClass(...)`, so keeping a specific checked type follows the review rule to avoid broad `Exception` signatures in test code when a narrower type is known.
Module:
jedis-1.4:javaagentModule path:
instrumentation/jedis/jedis-1.4/javaagentSummary
Applied 2 safe internal-visibility fixes in
jedis-1.4javaagent sources after reviewing all files under the module and validatingmetadata.yamlusage against the module code../gradlew :instrumentation:jedis:jedis-1.4:javaagent:check,./gradlew :instrumentation:jedis:jedis-1.4:javaagent:check -PtestLatestDeps=true, and./gradlew spotlessApplywere run; both:checkruns still hit the same pre-existing Jedis constructor-instrumentation failure.Applied Changes
Style
File:
JedisRequest.java:16Change: Changed `JedisRequest` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and `javaagent/src/main` classes are internal implementation details; this type is only used inside `io.opentelemetry.javaagent.instrumentation.jedis.v1_4`.
File:
JedisSingletons.java:16Change: Changed `JedisSingletons` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility for internal javaagent code, and this singleton holder is only referenced from the same package.
Unresolved Items
File:
javaagentReason: Both required validation runs, `:instrumentation:jedis:jedis-1.4:javaagent:check` and `:instrumentation:jedis:jedis-1.4:javaagent:check -PtestLatestDeps=true`, failed with a pre-existing ByteBuddy error while instrumenting `redis.clients.jedis.Jedis` and `redis.clients.jedis.BinaryJedis`: `IllegalStateException: Cannot catch exception during constructor call`. Investigate the existing constructor advice applied by the Jedis instrumentation; the visibility-only fixes here do not touch that path.
Module:
jedis-1.4:testingModule path:
instrumentation/jedis/jedis-1.4/testingSummary
Applied one safe cleanup-pattern fix in
jedis-1.4/testingby switching class-scoped resource teardown inAbstractJedisTesttoAutoCleanupExtension.deferAfterAll(...); dependentjavaagentvalidation remains blocked by a pre-existing Jedis adviceIllegalAccessError.Applied Changes
Testing
File:
AbstractJedisTest.java:39Change: Replaced the `@AfterAll` cleanup method with a registered `AutoCleanupExtension` and deferred cleanup for `redisServer` and `jedis` from `setup()`.
Reason: Repository testing guidance prefers `AutoCleanupExtension` with `deferAfterAll(...)` for class-scoped resources created in `@BeforeAll`, instead of an explicit `@AfterAll` cleanup chain.
Unresolved Items
File:
javaagentReason: Both `./gradlew :instrumentation:jedis:jedis-1.4:javaagent:check` and `./gradlew :instrumentation:jedis:jedis-1.4:javaagent:check -PtestLatestDeps=true` failed with a pre-existing `IllegalAccessError` (`redis.clients.jedis.Connection` could not access `io.opentelemetry.javaagent.instrumentation.jedis.v1_4.JedisRequest`), so dependent-module validation could not complete green for reasons unrelated to the review fix.
Module:
jedis-3.0:javaagentModule path:
instrumentation/jedis/jedis-3.0/javaagentSummary
Applied three safe review fixes in
instrumentation/jedis/jedis-3.0/javaagent: reduced two internal helper classes to package-private and moved class-scoped test cleanup inJedis30ClientTesttoAutoCleanupExtension.Applied Changes
Style
File:
JedisRequest.java:20Change: Changed `JedisRequest` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this javaagent helper is only used inside its package; sibling Jedis modules already use package-private `JedisRequest` classes.
File:
JedisSingletons.java:16Change: Changed `JedisSingletons` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this javaagent singleton holder is an internal implementation detail used only within the package.
Testing
File:
Jedis30ClientTest.java:48Change: Replaced the `@AfterAll` cleanup method with a registered `AutoCleanupExtension` and deferred cleanup for the Redis container and `Jedis` client from `@BeforeAll`.
Reason: `testing-general-patterns.md` says class-scoped resources created in shared setup should prefer `AutoCleanupExtension.deferAfterAll(...)` over manual `@AfterAll` cleanup chains when multiple cleanups are needed.
Module:
jedis-4.0:javaagentModule path:
instrumentation/jedis/jedis-4.0/javaagentSummary
Applied one safe review fix in
jedis-4.0javaagent tests:Jedis40ClientTestnow usesAutoCleanupExtension.deferAfterAll(...)for@BeforeAllresources, and its fixture fields use minimal necessary visibility.metadata.yamlwas reviewed and itsotel.instrumentation.common.db.query-sanitization.enabledentry matches the module'sDbConfigusage and default.Applied Changes
Testing
File:
Jedis40ClientTest.java:25Change: Replaced the class-scoped `@AfterAll` cleanup chain with `AutoCleanupExtension.deferAfterAll(...)` for the Redis container and `Jedis` client, and narrowed test fixture fields to `private`.
Reason: Repository testing guidance prefers `AutoCleanupExtension` for resources created in `@BeforeAll`, and the style guide requires minimal necessary visibility.
Module:
jedis-common:javaagentModule path:
instrumentation/jedis/jedis-common/javaagentSummary
Reviewed all hand-written files under
instrumentation/jedis/jedis-common/javaagentand did not find any safe, deterministic repository-guideline fixes to apply. The module contains onlybuild.gradle.ktsandJedisRequestContext.java; nometadata.yamlexists in this shared module, and the Jedis family metadata remains in the versioned sibling modules.Applied Changes
No safe automated changes were applied.
Module:
jetty-httpclient-12.0:javaagentModule path:
instrumentation/jetty-httpclient/jetty-httpclient-12.0/javaagentSummary
Applied 2 safe review fixes in
instrumentation/jetty-httpclient/jetty-httpclient-12.0/javaagent: removed unused exit-advice parameters and corrected a misleading context comment.Applied Changes
Style
File:
JettyClient12ResponseListenersInstrumentation.java:61Change: Removed unused `@Advice.Argument` and `@Advice.Thrown` parameters from the listener exit advice methods so they take only `@Advice.Enter @nullable Scope scope`.
Reason: Follows the general review rule to avoid dead code and unnecessary noise; these cleanup-only exit advice methods only use the entered `Scope`.
General
File:
JettyHttpClient12Instrumentation.java:66Change: Updated the comment above `request.attribute(JETTY_CLIENT_CONTEXT_KEY, parentContext)` to state that the stored value is the parent context for request/response listener callbacks.
Reason: Follows the general review rule to correct inaccurate or misleading comments; the attribute stores `parentContext`, not the started client-span context.
Download code review diagnostics